﻿

namespace MathLib
{
    public class MathFactory
    {
        public static IMath Create(MathMethod type)
        {
            IMath m = null;
            switch (type)
            {
                case MathMethod.Add:
                    m = new AddMath();
                    break;

                case MathMethod.Subtract:
                    m = new SubtractMath();
                    break;

                case MathMethod.Multiply:
                    m = new MultiplyMath();
                    break;

                case MathMethod.Divide:
                    m = new DivideMath();
                    break;

                    case MathMethod.Compounded:
                    m = new CompoundedMath();
                    break;
            }

            return m;
        }
    }
}
